package com.example.service;

import com.example.entity.*;

import com.example.mapper.AdoptMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdoptService {
    @Autowired
    private AdoptMapper adoptMapper;


    public void add(Adopt adopt) {
        adoptMapper.add(adopt);
    }

    public void update(Adopt adopt) {
        adoptMapper.update(adopt);
    }


    public PageInfo<Adopt> findBySearch(Params params) {
        PageHelper.startPage(params.getPageNum(), params.getPageSize());


        List<Adopt> list = adoptMapper.findBySearch(params);
        return PageInfo.of(list);
    }



}
